# 练习：使用selenium获取浏览器驱动，点击登录链接；停顿3秒，输入用户名和密码，再停顿3秒，点击登录的按钮；最后停顿3秒，关闭浏览器驱动
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
driver = webdriver.Firefox()
driver.get('https://www.tmooc.cn/')
sleep(3)
driver.find_element(By.LINK_TEXT, '登录').click()
sleep(3)
driver.find_element(By.ID, 'js_account_pm').send_keys('admin@163.com')
driver.find_element(By.ID, 'js_password').send_keys('123456')
sleep(3)
driver.find_element(By.ID, 'js_submit_login').click()
sleep(3)
driver.quit()